import { Vue } from 'vue';
import { createRouter, createWebHistory } from 'vue-router'
const routes = [
    {
      path: '/Home',
      name: 'Home',
      component:()=>import('../components/Home.vue'), 
    },
    {
        path:'/login',
        name:'login',
        component:()=>import('../pages/login.vue'), 
    },
    {
        path:'/console',
        name:'console',
        component:()=>import('../pages/index.vue'),
        // 添加子路由
        children: [
            {
                path: '/pay/info', // 支付详情
                name: '/pay_info',
                component: () => import('../pages/account/pay/Info.vue')
            },
            {
                path: '/user/info', // 用户管理
                name: '/user_info',
                component: () => import('../pages/user/index.vue')
            },
            {
                 path: '/message/index', // 消息中心
                name: '/message_index',
                component: () => import('../pages/message/index.vue')
            },
            {
                 path: '/friend/index', // 朋友中心
                name: '/friend_index',
                component: () => import('../pages/friend/index.vue')
            }
        ]
    }
  ]
  const router = createRouter({
    history: createWebHistory(),
    routes
  })
  export default router